package jp.co.systemi.asp.workflow.data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.slim3.datastore.Attribute;
import org.slim3.datastore.CreationDate;
import org.slim3.datastore.CreationUser;
import org.slim3.datastore.Model;
import org.slim3.datastore.ModificationDate;
import org.slim3.datastore.ModificationUser;

import com.google.appengine.api.datastore.Key;
@Model
public class Apply implements Serializable{
    private static final long serialVersionUID = -7005088091992506374L;
    @Attribute(primaryKey = true)
    private Key id;
    private String applyee;		// 申請者
    private String category; 	// 申請種別（有給休暇、夏季休暇など）
    List<Long> refIds = new ArrayList<Long>();	//申請対象のキー
    private Common.APPLY_STATUS status;
    private Integer seq;
    private String approver;
    private String approverGroupCode;
    private Key summaryId;
    private String role;
    private String memo;

    @Attribute(listener = CreationDate.class)
    private Date regDate = null;
    @Attribute(listener = CreationUser.class)
    private com.google.appengine.api.users.User regUser;
    @Attribute(listener = ModificationDate.class)
    private Date updDate = null;
    @Attribute(listener = ModificationUser.class)
    private com.google.appengine.api.users.User updUser;

    // 保存しない項目
    @Attribute(persistent = false)
    private String approverGroupName;		//承認者の組織名
    @Attribute(persistent = false)
    private String approverName;		//承認者の組織名
    @Attribute(persistent = false)
    private String applyeeName;
    @Attribute(persistent = false)
    private Boolean select;

    public void addRefId(Long id){
        refIds.add(id);
    }
    public com.google.appengine.api.users.User getRegUser() {
        return regUser;
    }

    public void setRegUser(com.google.appengine.api.users.User user) {
        this.regUser = user;
    }

    public void setUpdUser(com.google.appengine.api.users.User updUser) {
        this.updUser = updUser;
    }

    public com.google.appengine.api.users.User getUpdUser() {
        return updUser;
    }
    public Key getId() {
        return id;
    }

    public void setId(Key id) {
        this.id = id;
    }
    public Date getRegDate() {
        return regDate;
    }

    public void setRegDate(Date regDate) {
        this.regDate = regDate;
    }

    public Date getUpdDate() {
        return updDate;
    }

    public void setUpdDate(Date updDate) {
        this.updDate = updDate;
    }

    public Integer getSeq() {
        return seq;
    }

    public void setSeq(Integer seq) {
        this.seq = seq;
    }

    public Boolean getSelect() {
        return select;
    }

    public void setSelect(Boolean select) {
        this.select = select;
    }

    public String getApplyee() {
        return applyee;
    }

    public void setApplyee(String applyee) {
        this.applyee = applyee;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String catagory) {
        this.category = catagory;
    }

    public List<Long> getRefIds() {
        return refIds;
    }

    public void setRefIds(List<Long> refIds) {
        this.refIds = refIds;
    }

    public Common.APPLY_STATUS getStatus() {
        return status;
    }

    public void setStatus(Common.APPLY_STATUS status) {
        this.status = status;
    }
    public String getApprover() {
        return approver;
    }
    public void setApprover(String approver) {
        this.approver = approver;
    }
    public Key getSummaryId() {
        return summaryId;
    }
    public void setSummaryId(Key summaryId) {
        this.summaryId = summaryId;
    }
    public String getRole() {
        return role;
    }
    public void setRole(String role) {
        this.role = role;
    }
    public String getApproverGroupName() {
        return approverGroupName;
    }
    public void setApproverGroupName(String groupName) {
        this.approverGroupName = groupName;
    }
    public String getApplyeeName() {
        return applyeeName;
    }
    public void setApplyeeName(String userName) {
        this.applyeeName = userName;
    }
    public String getMemo() {
        return memo;
    }
    public void setMemo(String memo) {
        this.memo = memo;
    }
    public String getApproverName() {
        return approverName;
    }
    public void setApproverName(String approverName) {
        this.approverName = approverName;
    }
    public String getApproverGroupCode() {
        return approverGroupCode;
    }
    public void setApproverGroupCode(String approverGroupCode) {
        this.approverGroupCode = approverGroupCode;
    }

}
